/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-20 20:32:30
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-20 22:02:01
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/components/animation_text.dart';
import 'package:flutter_data_center/model/attendance/school_attendance_model.dart';
import 'package:flutter_data_center/screens/attendance/student/grade/grade_attendance_screen.dart';
import 'package:flutter_data_center/utills/color_utils.dart';
import 'package:flutter_data_center/utills/navigator_utils.dart';

class SchoolItem extends StatelessWidget {
  const SchoolItem({Key key, this.grade}) : super(key: key);
  final Grades grade;

  @override
  Widget build(BuildContext context) => InkWell(
        borderRadius: BorderRadius.circular(10),
        onTap: () {
          NavigatorUtils.pushPageByFade(
            context: context,
            targetPage: GradeAttendanceScreen(),
            isReplace: false,
            startMills: 500,
          );
        },
        child: Column(
          children: [
            SizedBox(height: 15),
            Container(
              height: 80,
              width: double.infinity,
              padding: EdgeInsets.only(left: 10, right: 10, top: 6, bottom: 13),
              decoration: BoxDecoration(
                color: gColor("#F5F7F9"),
                borderRadius: BorderRadius.circular(10),
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Column(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Container(
                        height: 24,
                        alignment: Alignment.center,
                        padding: EdgeInsets.symmetric(horizontal: 8),
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(40),
                          color: gColor("#08D187"),
                        ),
                        child: Text(
                          grade.classname,
                          style: TextStyle(
                            fontSize: 12,
                            height: 1,
                            color: Colors.white,
                          ),
                        ),
                      ),
                      Row(
                        children: [
                          Text(
                            "班级人数",
                            style: TextStyle(
                              fontSize: 12,
                              color: gColor("#C8C8C8"),
                            ),
                          ),
                          SizedBox(width: 17),
                          AnimText(
                            number: grade.total,
                            style: TextStyle(
                              fontSize: 13,
                              color: gColor("#1D1D1D"),
                            ),
                          ),
                        ],
                      )
                    ],
                  ),
                  Column(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      AnimText(
                        number: grade.attendance,
                        style: TextStyle(
                          fontSize: 26,
                          color: Colors.black,
                          fontWeight: FontWeight.w700,
                        ),
                      ),
                      Text(
                        "到校人数",
                        style: TextStyle(
                          fontSize: 12,
                          color: gColor("#C8C8C8"),
                        ),
                      ),
                    ],
                  )
                ],
              ),
            ),
          ],
        ),
      );
}
